file_name = 'text_files\\guest_book.txt'

with open(file_name,'w') as file_object:
    name = input("Enter your name: ")
    while name!='-1':
        print(f"Hello,{name} !")
        file_object.write(f"{name}\n")
        name = input("Enter your name: ")
